﻿using Wenyu.Framework.DbModels.Entities;
using Wenyu.Framework.IBusinessServices;
using Wenyu.Framework.ModelDto;

namespace Wenyu.Framework.WebCore.AutoMapperExtend
{
    public class WebApiAutoMapperProfile:AutoMapper.Profile
    {
        public WebApiAutoMapperProfile()
        {
            CreateMap<UserEntity, UserDto>()
                .ForMember(c=>c.UserId,s=>s.MapFrom(x=>x.UserId))
                .ForMember(c => c.Name, s => s.MapFrom(x => x.Name))
                .ReverseMap();
            CreateMap<UserEntity, AddUserDto>()              
                .ReverseMap();

            CreateMap<PagingData<UserEntity>, PagingData<UserDto>>();

            //CreateMap<UserInfoDto, LoginDto>().ReverseMap();
            //CreateMap<UserInfo, UserInfoDto>().ReverseMap();
            //CreateMap<UserInfoInput, UserInfo>();
            
        }
    }
}
